<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<fieldset>
	<legend>
		<strong>Employee Information</strong>
	</legend>

	<div id="content_main">
		<form:form id="form" name="form_employee" method="post"
			action="/ChitFund/user/saveEmployee.htm">
			<table>
				<tr>
					<td><strong><label>Name </label></strong></td>
					<td><form:input path="firstName"></form:input></td>
					<td><form:input path="middleName"></form:input></td>
					<td><form:input path="lastName"></form:input></td>
				</tr>
				<tr>
					<td><form:label path="branch.branchId">Branch</form:label></td>
					<td><select name="branch.branchId">
							<option selected="selected" value="null">select Branch</option>
							<c:forEach var="branch" items="${branches}">
								<option value="${branch.branchId}">
									<c:out value="${branch.branchName}" />
								</option>
							</c:forEach>
					</select></td>
				</tr>
				<tr>
					<td><form:label path="address">Address</form:label></td>
					<td><form:input path="address" value="${employee.address}" /></td>
				</tr>
				<tr>
					<td><form:label path="birthDate">Birth Date</form:label></td>
					<td><form:input path="birthDate" value="${employee.birthDate}" /></td>
				</tr>

				<tr>
					<td><form:label path="phoneNo">Phone No.</form:label></td>
					<td><form:input path="phoneNo" value="${employee.phoneNo}" /></td>
				</tr>
				<tr>
					<td><form:label path="mobileNo">Mobile No.</form:label></td>
					<td><form:input path="mobileNo" value="${employee.mobileNo}" /></td>
				</tr>
				<tr>
					<td><form:label path="joinDate">joinDate</form:label></td>
					<td><form:input path="joinDate" value="${employee.joinDate}" /></td>
				</tr>
				<tr>
					<td><form:label path="designation">designation.</form:label></td>
					<td><form:input path="designation"
							value="${employee.designation}" /></td>
				</tr>
				<tr>
					<td><form:label path="gender">gender</form:label></td>
					<td><form:input path="gender" value="${employee.gender}" /></td>
				</tr>

			</table>
			<div class="form-btn">
				<input type="submit" name="Save" id="Save" value="Save"
					class="btn btn-large" /> <input type="reset" name="Clear"
					id="Clear" value="Reset" class="btn btn-large" />

			</div>
		</form:form>
	</div>
	<div class="span11">

		<h3>employees</h3>

		<c:if test="${!empty employeeList}">
			<table id="tblData"
				class="table table-bordered table-striped table-hover">
				<thead>
					<tr>

						<th>employeeName</th>
						<th>address</th>
						<th>phoneNo</th>
						<th>mobileNo</th>
						<th>Action</th>
					</tr>
				</thead>
				<tbody>

					<c:forEach items="${employeeList}" var="employee">
						<tr>

							<td>${employee.firstName} ${employee.middleName}
								${employee.lastName}</td>
							<td>${employee.address}</td>
							<td>${employee.phoneNo}</td>
							<td>${employee.mobileNo}</td>
							<td><a
								href="/ChitFund/deleteEmployee.htm?id=${employee.employeeId}">delete</a></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</c:if>

		<c:if test="${empty employeeList }">
			<c:out value="No employee">
			</c:out>
		</c:if>
	</div>
</fieldset>